home *** CD-ROM | disk | FTP | other *** search
-
- setblack 1
- load 1,"usmap1" :rem we need a blank screen, so use something handy
- pen 0,1
- pen 1,0
- clear
- setblack 0 :rem reveal not that screen's blank
-
- array 1000,2 :rem place to put data
- pointer 1
-
- 10
- abort 1
- clear
- move 10,10
- text "Mask file name?"
- move 0,30
- input $(0),40
- if @(0)=0:end:endif :rem none specified
-
- mode=0
- open mode,$(0) :rem try to open the file
- if mode=0
- move 0,50
- text "Can't find file"
- abort 0
- 5
- ifkey key
- ifmouse x,y
- if x#-1 | key#-1:goto 10:endif
- pause 1
- goto 5
- endif
- close
-
- load 2,$(0) :rem load the selected file
- resolution 2,xmax,ymax,dep
-
- table=100 :rem location of table in array
- butcount=0
- butsize=7 :rem size of button entry
-
- abort 0
- 20
- display 1
- clear
- move 20,50
- text butcount;" buttons defined"
-
- rem draw MORE and DONE buttons
- move 10,10
- draw 60,10
- draw 60,30
- draw 10,30
- draw 10,10
- move 18,24
- text "MORE"
- move 70,10
- draw 130,10
- draw 130,30
- draw 70,30
- draw 70,10
- move 78,24
- text "DONE"
-
- getmouse x,y
-
- if x>70 & y>10 & x<130 & y<30 :rem done
- mode=1
- open mode,"ram:btable" :rem write output to this file
- 99
- write @(table)
- if @(table)#-1:table=table+1:goto 99:endif
- close
- end
- endif
-
- if x>10 & y>10 & x<60 & y<30
- gosub 100 :rem more selected
- endif
-
- goto 20
-
-
-
- 100
- display 2
- gosub 200 :rem get a box
- display 1
- clear
- move 10,10
- text "Now pick button color"
- getmouse u,v
- display 2
- gosub 220 :rem redraw the box
- getmouse xc,yc :rem get color/fill location
- gosub 220 :rem erase the box
- getpen bcolor,xc,yc :rem get the button color
-
- loc=table+butcount*butsize
- @(loc)=x
- @(loc+1)=y
- @(loc+2)=xa
- @(loc+3)=ya
- @(loc+4)=bcolor
- @(loc+5)=xc
- @(loc+6)=yc
- @(loc+butsize)=-1 :rem end of table
- butcount=butcount+1
- return
-
- rem draw box
- 200
- getmouse x,y
- gosub 210 :rem draw corner
- getmouse xa,ya
- gosub 210 :rem erase corner
- 205
- gosub 220 :rem draw box
- 201
- ifkey key
- if key#-1:gosub 220:return:endif :rem box selected
- ifmouse xb,yb
- if xb=-1:pause 1:goto 201:endif
-
- da=(x-xb)*(x-xb)+(y-yb)*(y-yb)
- db=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb)
-
- gosub 220 :rem erase box
-
- rem replace closest click
- if da<db
- x=xb:y=yb
- else
- xa=xb:ya=yb
- endif
- goto 205
-
- rem draw corner
- 210
- drawmode 2 :rem xor mode
- move x,y
- draw xmax_(x+20),y
- move x,ymax_(y+1)
- draw x,ymax_(y+10)
- drawmode -1
- return
-
- rem draw box
- 220
- drawmode 2 :rem xor mode
- move x,y
- draw xa,y
- draw xa,ya
- draw x,ya
- draw x,y
- drawmode -1
- return
-
-